// pages/zixun/shaixuanjieguo/shaixuanjieguo.js
Page({
  data: {
    consultantList: [], 
    filters: {} 
  },
 
  onLoad(options) {
    if (options.filters) {
      this.setData({
        filters: JSON.parse(decodeURIComponent(options.filters))
      });
      
      this.fetchConsultants(JSON.parse(decodeURIComponent(options.filters)));
    }
  },
 
  fetchConsultants(filters) {
    wx.request({
      url: 'http://localhost:8080/consultant/filter', // 替换为你的实际接口地址
      method: 'POST',
      data: filters,
      success: (res) => {
        console.log('Response received:', res); 
        this.setData({
          consultantList: res.data
        });
      },
      fail: (err) => {
        console.error('请求失败:', err);
      }
    });
  },
 
  click1(){
    wx.navigateTo({
      url: '/pages/zixun/dianjizixun/dianjizixun',
    })
  },
 
  onReady() {

  },

 
  onShow() {

  },

  
  onHide() {

  },


  onUnload() {

  },


  onPullDownRefresh() {

  },


  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})